using System;
using System.Data;
using System.Collections;

namespace APP.QUANLY.Entity
{
     /// <summary>
     /// Summary description for KHO.
     /// </summary>
     public class KHO
    {
              private Guid _MAKHO;
      private string _MACODE;
      private string _TENKHO;
      private string _DIACHI;
      private bool _ISUSE;
      private bool _KHOMACDINH;
      private string _GHICHU;
      private HOADONXUATKHOCHITIETList _listHOADONXUATKHOCHITIET;
      private HOADONHAPKHOCHITIETList _listHOADONHAPKHOCHITIET;
      private KHOMATHANGList _listKHOMATHANG;
        private bool isExisting;
        #region Properties
        public bool IsExisting
        {
              get{return isExisting;}
              set{isExisting = value;}
        }
		      public bool IsMAKHONullable
      { get { return false;  } }
      public Guid MAKHO
      {
         get { return _MAKHO; }
         set { _MAKHO = value; }
      }
      public bool IsMACODENullable
      { get { return true;  } }
      public string MACODE
      {
         get { return _MACODE;  }
         set { _MACODE = value; }
      }
      public bool IsTENKHONullable
      { get { return true;  } }
      public string TENKHO
      {
         get { return _TENKHO;  }
         set { _TENKHO = value; }
      }
      public bool IsDIACHINullable
      { get { return true;  } }
      public string DIACHI
      {
         get { return _DIACHI;  }
         set { _DIACHI = value; }
      }
      public bool IsISUSENullable
      { get { return true;  } }
      public bool ISUSE
      {
         get { return _ISUSE;  }
         set { _ISUSE = value; }
      }
      public bool IsKHOMACDINHNullable
      { get { return true;  } }
      public bool KHOMACDINH
      {
         get { return _KHOMACDINH;  }
         set { _KHOMACDINH = value; }
      }
      public bool IsGHICHUNullable
      { get { return true;  } }
      public string GHICHU
      {
         get { return _GHICHU;  }
         set { _GHICHU = value; }
      }
public HOADONXUATKHOCHITIETList HOADONXUATKHOCHITIETList 
{ 
	get { return _listHOADONXUATKHOCHITIET; }
	set { _listHOADONXUATKHOCHITIET = value;}
}
public HOADONHAPKHOCHITIETList HOADONHAPKHOCHITIETList 
{ 
	get { return _listHOADONHAPKHOCHITIET; }
	set { _listHOADONHAPKHOCHITIET = value;}
}
public KHOMATHANGList KHOMATHANGList 
{ 
	get { return _listKHOMATHANG; }
	set { _listKHOMATHANG = value;}
}

        #endregion

        #region Constructors
        public KHO()
        {
            Reset();
        }
        public KHO(KHO obj)
        {
            	this._MAKHO = obj.MAKHO;
	this._MACODE = obj.MACODE;
	this._TENKHO = obj.TENKHO;
	this._DIACHI = obj.DIACHI;
	this._ISUSE = obj.ISUSE;
	this._KHOMACDINH = obj.KHOMACDINH;
	this._GHICHU = obj.GHICHU;
        }
        #endregion

        public void Reset()
        {
                     _MAKHO = EmptyValues.v_Guid;
         _MACODE = EmptyValues.v_string;
         _TENKHO = EmptyValues.v_string;
         _DIACHI = EmptyValues.v_string;
         _ISUSE = EmptyValues.v_bool;
         _KHOMACDINH = EmptyValues.v_bool;
         _GHICHU = EmptyValues.v_string;
	_listHOADONXUATKHOCHITIET = null;
	_listHOADONHAPKHOCHITIET = null;
	_listKHOMATHANG = null;
        }

         
        #region Hidden

        /*
        private void readProperties(IDataReader reader)
        {
            try
            {
                                if(!(reader["MAKHO"] is DBNull))
		{
			obj.MAKHO = (Guid)reader["MAKHO"];
		}
                if(!(reader["MACODE"] is DBNull))
		{
			obj.MACODE = (string)reader["MACODE"];
		}
                if(!(reader["TENKHO"] is DBNull))
		{
			obj.TENKHO = (string)reader["TENKHO"];
		}
                if(!(reader["DIACHI"] is DBNull))
		{
			obj.DIACHI = (string)reader["DIACHI"];
		}
                if(!(reader["ISUSE"] is DBNull))
		{
			obj.ISUSE = (bool)reader["ISUSE"];
		}
                if(!(reader["KHOMACDINH"] is DBNull))
		{
			obj.KHOMACDINH = (bool)reader["KHOMACDINH"];
		}
                if(!(reader["GHICHU"] is DBNull))
		{
			obj.GHICHU = (string)reader["GHICHU"];
		}
//            _MAKHO = (reader["MAKHO"] is DBNull)?DalTools.EmptyValues.v_Guid:(Guid)reader["MAKHO"];
//            _MACODE = (reader["MACODE"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["MACODE"];
//            _TENKHO = (reader["TENKHO"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["TENKHO"];
//            _DIACHI = (reader["DIACHI"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["DIACHI"];
//            _ISUSE = (reader["ISUSE"] is DBNull)?DalTools.EmptyValues.v_bool:(bool)reader["ISUSE"];
//            _KHOMACDINH = (reader["KHOMACDINH"] is DBNull)?DalTools.EmptyValues.v_bool:(bool)reader["KHOMACDINH"];
//            _GHICHU = (reader["GHICHU"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["GHICHU"];
            }
            catch (Exception ex)
            {
                throw new DalException("Failed to read properties from DataReader.", ex);
            }
        } 
        */

        #endregion


        public void Fill(Guid MAKHO, string MACODE, string TENKHO, string DIACHI, bool ISUSE, bool KHOMACDINH, string GHICHU)
        {
                     this._MAKHO = MAKHO;
         this._MACODE = MACODE;
         this._TENKHO = TENKHO;
         this._DIACHI = DIACHI;
         this._ISUSE = ISUSE;
         this._KHOMACDINH = KHOMACDINH;
         this._GHICHU = GHICHU;
        }
    }
}